package com.mornd.gulimall.search.entity;

import com.mornd.gulimall.apis.search.to.SkuEsModel;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author: mornd
 * @dateTime: 2023/8/13 - 21:06
 * 检索返回的结果
 */

@Getter
@Setter
public class SearchResult {
    /**
     * 回显关键字
     */
    private String keyword;

    private Long catalog3Id;
    private Long brandId;

    /**
     * 商品集合
     */
    private List<SkuEsModel> products;
    /**
     * 品牌
     */
    private List<BrandVo> brands;
    /**
     * 当前结果所涉及到的所有属性
     */
    private List<AttrVo> attrs;
    /**
     * 分类
     */
    private List<CatalogVo> catalogs;

    /**
     * 排序
     */
    private String sort;

    /**
     * 价格区间
     */
    // >=
    private BigDecimal priceL;
    // <=
    private BigDecimal priceR;

    private Integer hasStock;

    /**
     * 🍞屑导航数据
     */
    private List<NavVo> navs;

    /**
     * 当前页
     */
    private Long pageNum;
    /**
     * 当前分页总页数
     */
    private Long pages;

    /**
     * 页码
     */
    private List<Integer> pageNavs;
    /**
     * 总条数
     */
    private Long total;


    @Getter
    @Setter
    public static class BrandVo {
        private Long brandId;
        private String brandName;
        private String brandImg;
    }

    @Getter
    @Setter
    public static class AttrVo {
        private Long attrId;
        private String attrName;
        private List<String> attrValue;
    }

    @Getter
    @Setter
    public static class CatalogVo {
        private Long catalogId;
        private String catalogName;
    }

    @Getter
    @Setter
    public static class NavVo {
        private Long id;
        private String name;
        private String value;
    }

}
